home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / telecomm / sticpsrc.lzh / SOURCE.ARC / PCINT.ASM < prev    next >
Assembly Source File  |  1989-08-14  |  833b  |  42 lines

  1.     NAME pcint
  2.     include    pmacros.h
  3.  
  4. dseg
  5. pubvar    sssave,<dw ?>
  6. pubvar    spsave,<dw ?>
  7.     db    512 dup(?)
  8. pubvar    intstk,<label byte>
  9. pubvar    isat,<db 0>
  10. dsegend
  11.  
  12. ; common routine for interrupt return
  13.     pubproc    doret
  14.     pop    es
  15.     pop    di
  16.     pop    si
  17.     pop    bp
  18.     pop    dx
  19.     pop    cx
  20.     pop    bx
  21.     cmp    isat@,1
  22.     jnz    notat        ; Only one 8259, so skip this stuff
  23.     mov    al,0bh        ; read in-service register from
  24.     out    0a0h,al        ; secondary 8259
  25.     jmp    short d1    ; Delay
  26. d1:    in    al,0a0h        ; get it
  27.     or    al,al        ; Any bits set?
  28.     jz    notat        ; nope, not a secondary interrupt
  29.     mov    al,20h        ; Get EOI instruction
  30.     out    0a0h,al        ; Secondary 8259 (PC/AT only)
  31.     jmp    short notat    ; Delay
  32. notat:    mov    al,20h        ; Get EOI instruction
  33.     out    20h,al        ; Primary 8259
  34.     mov    ss,sssave@
  35.     mov    sp,spsave@    ; restore original stack context
  36.     pop    ds
  37.     pop    ax
  38.     iret
  39.     pend    doret
  40.  
  41.     end
  42.